
import { Agent as httpsAgent } from "https";
import { Agent as httpAgent } from "http";
import axios from 'axios'


export const server = axios.create({
  // `baseURL` 将自动加在 `url` 前面，除非 `url` 是一个绝对 URL。
  // 它可以通过设置一个 `baseURL` 便于为 axios 实例的方法传递相对 URL
  baseURL: 'https://api.snowcrystal.com/',
  maxContentLength: 2400,
  maxBodyLength: 2000,
  maxRedirects: 4,
  httpAgent: new httpAgent({ keepAlive: true }),
  httpsAgent: new httpsAgent({ keepAlive: true }),
  // xsrfCookieName: 'SNCS-XSRF-TOKEN',
  // xsrfHeaderName: 'X-XSRF-TOKEN',
  // 如果请求时间超过 `timeout` 的值，则请求会被中断
  timeout: 1000, // 默认值是 `0` (永不超时)
  proxy: false,
  auth:undefined,
  decompress: true,
})
